﻿@inherits LayoutComponentBase
@layout MainLayout
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption

<div class="bb-title">
    <BBLogo />
    <span>@Title</span>
</div>

<div class="text-center">
    <ImageViewer Alt="gitee" IsAsync="true" Url="@GVPUrl" />
    <ImageViewer Alt="oscs" IsAsync="true" Url="https://www.oscs1024.com/platform/badge/murphysecurity/murphysec.svg" />
    <span class="d-none d-sm-inline">
        <ImageViewer Alt="version" IsAsync="true" Url="https://img.shields.io/nuget/vpre/BootstrapBlazor.svg?logo=nuget&logoColor=green" />
        <ImageViewer Alt="license" IsAsync="true" Url="https://img.shields.io/github/license/argozhang/bootstrapblazor.svg?logo=git&logoColor=red" />
        <ImageViewer Alt="download" IsAsync="true" Url="https://img.shields.io/nuget/dt/BootstrapBlazor.svg?logo=nuget&logoColor=green" />
        <ImageViewer Alt="repo" IsAsync="true" Url="https://img.shields.io/github/repo-size/ArgoZhang/BootstrapBlazor.svg?logo=github&logoColor=green&label=repo" />
        <ImageViewer Alt="commit" IsAsync="true" Url="https://img.shields.io/github/last-commit/ArgoZhang/BootstrapBlazor/main.svg?logo=github&logoColor=green&label=commit" />
        <ImageViewer Alt="build" IsAsync="true" Url="https://img.shields.io/github/actions/workflow/status/ArgoZhang/BootstrapBlazor/build.yml?branch=main&?label=main&logo=github" />
    </span>
    <ImageViewer Alt="coverage" IsAsync="true" Url="https://codecov.io/gh/dotnetcore/BootstrapBlazor/branch/main/graph/badge.svg?token=5SXIWHXZC3" />
</div>

@if (AnySourceCodes)
{
    <Tab IsBorderCard="true" @ref="TabSet">
        <TabItem Text="@Example" Icon="fa-solid fa-desktop">
            <CascadingValue Value="@RazorFileName" Name="RazorFileName" IsFixed="true">
                @Body
            </CascadingValue>
        </TabItem>
        <TabItem Text="Razor" Icon="fa-brands fa-html5">
            <Pre @key="@RazorFileName" CodeFile="@RazorFileName"></Pre>
        </TabItem>
        <TabItem Text="C#" Icon="fa-regular fa-file-code">
            <Pre @key="@CsharpFileName" CodeFile="@CsharpFileName"></Pre>
        </TabItem>
        <TabItem Text="@Video" Icon="fa-regular fa-file-video">
            <Video @key="@VideoFileName" Name="@VideoFileName"></Video>
            <p><b>交流群</b></p>
            <QQGroup />
        </TabItem>
    </Tab>
}
else
{
    <CascadingValue Value="@RazorFileName" Name="RazorFileName" IsFixed="true">
        @Body
    </CascadingValue>
}

<div class="tab-navigators">
    <Button OnClickWithoutRender="() => Goto(2)" Icon="fa-regular fa-file-code" class="btn-fade btn-circle" TooltipText="@Localizer["ViewC#Code"]"></Button>
    <Button OnClickWithoutRender="() => Goto(1)" Icon="fa-brands fa-html5" class="btn-fade btn-circle" Color="Color.Success" TooltipText="@Localizer["ViewRazorCode"]"></Button>
    <Button OnClickWithoutRender="() => Goto(0)" Icon="fa-solid fa-book" class="btn-fade btn-circle" Color="Color.Warning" TooltipText="@Localizer["ViewExample"]"></Button>
</div>
